class Solution:
    def lengthOfLIS(self, nums) -> int:
        if len(nums) == 0:
            return 0
        dp = [1] * len(nums)
        for i in range(1, len(nums)):
            maxLen = 1
            for j in range(i):
                if nums[i] > nums[j]:
                    maxLen = max(maxLen, dp[j] + 1)
            dp[i] = maxLen
        return max(dp)

if __name__ == '__main__':
    so = Solution()
    m = [10,9,2,5,3,7,101,18]
    r = so.lengthOfLIS(m)
    print(r)
